package edu.depaul.se.courseregistration.sessionbean;

import edu.depaul.se.courseregistration.jpa.schedule.Schedule;
import java.util.List;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Group2
 */

@Stateless
@LocalBean
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public class ScheduleEJB {
    
    @PersistenceContext(unitName="CourseRegistrationModulePU")
    private EntityManager em;  
     
    //@Override
     public List <Schedule> findAllSchedule (){
       return em.createNamedQuery(Schedule.CLASS_QUERY_GET_ALL, Schedule.class).getResultList();
     }
     
}
